<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

        

            <ui:define name="content">
                <f:view>
                    <p:panel header="crear articulo">
                    <h:form>
                       <p:growl life="2000"/>
                        <h:panelGrid columns="2">
                            <p:outputLabel value="Idarticulo:" for="idarticulo" />
                            <p:inputText id="idarticulo" value="#{articleBean.article.idarticulo}" title="Idarticulo" required="true" requiredMessage="The Idarticulo field is required." validatorMessage=" numero entre 1 y 1000">
                                <f:validateLongRange minimum="1" maximum="1000"/>
                            </p:inputText>
                            <p:outputLabel value="estado:" for="tipollanta" />
                            <p:inputText id="tipollanta" value="#{articleBean.article.tipollanta}" title="Tipollanta" validatorMessage=" requiere RETURN" >
                                <f:validateRegex pattern="(RETURN)"/>
                            </p:inputText>
                            <p:outputLabel value="Marca:" for="marca" />
                            <p:inputText id="marca" value="#{articleBean.article.marca}" title="Marca" validatorMessage="solo numero o letras">
                            <f:validateRegex pattern="([A-Za-z0-9\s]+)$"/>
                            </p:inputText>
                                
                            
                            <p:outputLabel value="Rodado:" for="rodado" />
                            <p:inputText id="rodado" value="#{articleBean.article.rodado}" title="Rodado" validatorMessage="solo numero" >
                                <f:validateLongRange minimum="1" maximum="100"/>
                             </p:inputText>
                            <h:outputLabel value="Numeracion:" for="numeracion" />
                            <p:inputMask  value="#{articleBean.numeracion}"  mask="999x999" required="true" validatorMessage="solo numero"/> 
                          
                                
                             
                            <p:outputLabel value="Precio:" for="precio" />
                            <p:inputText id="precio" value="#{articleBean.article.precio}" title="Precio" required="true" validatorMessage="solo numero">
                                <f:validateLongRange minimum="1" maximum="50000"/>
                            </p:inputText>
                            <p:outputLabel value="Garantia:" for="garantia" />
                            <p:inputText id="garantia" value="#{articleBean.article.garantia}" title="Garantia" required="true" validatorMessage="solo numero" >
                                <f:validateLongRange minimum="0" maximum="100"/>
                            </p:inputText>
                            
                            <p:outputLabel value="Clave:" for="clave" />
                            <p:inputText id="clave" value="#{articleBean.article.clave}" title="Clave" validatorMessage=" clave numero entre 1000 y 9999" >
                            <f:validateLongRange minimum="1000" maximum="9999"/>
                            </p:inputText>
                        </h:panelGrid>
                        <h:panelGrid columns="3">
                            <p:commandButton action="ArticuloConfirmar" value="confirmar" ajax="false"/>
                            <p:commandButton action="MenuPrincipal" value="cancelar" immediate="true" ajax="false"/>
                            <p:commandButton action="#{articleBean.procesarAccion}" value="eliminar" ajax="false"/>
                        </h:panelGrid>
                    </h:form>
                  </p:panel>
                </f:view>


            </ui:define>


        </ui:composition>

    </body>
</html>
